{include file="Public:header" /}
<script type="text/javascript" src="__PUBLIC__/Home/activity/js/jquery-2.1.0.js"></script>
<div class="bar bar-nav">
    <h1 class="title">{$data['traffic_name']}</h1>
    <i class="icon icon-left" onclick="window.history.go(-1);"></i>
</div>

<nav class="bar bar-tab">
    <a class="tab-item active" href="{:U('Index/index')}">
        <span class="icon icon-home"></span>
        <span class="tab-label">首页</span>
    </a>
    <a class="tab-item" href="tel:{$data['mobile']}">
        <span class="icon iconfont icon-phone"></span>
        <span class="tab-label">咨询</span>
    </a>
    <!--<a class="tab-item" href="#">
        <span class="icon iconfont icon-account"></span>
        <span class="tab-label">我要加入</span>
    </a>-->
</nav>

<div class="content">
    <div class="hotel_top clearfix">
        <div class="hotel_top_img">
            <img style="width: 144px;height: 144px;" src="{$data['smallimage']}">
        </div>
        <div class="hotel_top_text">
            <h3>{$data['traffic_name']}</h3>
            <p><span><i class="iconfont icon-map"></i></span>{$data['address']}</p>
            <p><a href="tel:{$data['mobile']}"><span><i class="iconfont icon-phone"></i></span>{$data['mobile']}</a></p>
            <p>访问：<font>{$data['number']}</font></p>
        </div>
    </div>
   <!-- <div class="list-block mechan_user" style="margin-top:0rem;margin-bottom:1rem;">
        <form method="post" id="user_hotel">
            <input name="hotel_id" type="hidden" value="{$data['id']}">
            <ul>
                <li>
                    <div class="item-content">
                        <div class="item-media"><i class="icon icon-form-name"></i></div>
                        <div class="item-inner">
                            <div class="item-title label">类 型</div>
                            <div class="item-input">
                                <select id="room_cateid" name="room_cateid">
                                    <option value="">请选择房间类型</option>
                                    <option value="1">标准客房</option>
                                    <option value="2">双人客房</option>
                                    <option value="3">豪华套房</option>
                                    <option value="4">其它</option>
                                </select>
                            </div>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="item-content">
                        <div class="item-media"><i class="icon icon-form-email"></i></div>
                        <div class="item-inner">
                            <div class="item-title label">房间数</div>
                            <div class="item-input">
                                <input value="1" name="room_num" type="text" placeholder="填写房间数量">
                            </div>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="item-content">
                        <div class="item-media"><i class="icon icon-form-gender"></i></div>
                        <div class="item-inner">
                            <div class="item-title label">入住人数</div>
                            <div class="item-input">
                                <input value="1" name="user_num" type="text" placeholder="填写你的入住人数">
                            </div>
                        </div>
                    </div>
                </li>
                &lt;!&ndash; Date &ndash;&gt;
                <li>
                    <div class="item-content">
                        <div class="item-media"><i class="icon icon-form-calendar"></i></div>
                        <div class="item-inner">
                            <div class="item-title label">手机号</div>
                            <div class="item-input">
                                <input name="mobile" type="tel" placeholder="填写手机号方便联系">
                            </div>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="item-content">
                        <button class="button button-fill" style="height:30px;margin:10px auto;width:4rem;">提交</button>
                    </div>
                </li>
            </ul>
        </form>
    </div>-->
    <div class="buttons-tab mechan-page-tab" style="margin-top:0px;">
        <!-- <a href="#tab1" class="tab-link active button">发布的活动</a> -->
        <a href="#tab2" class="tab-link button active">详情介绍</a>
    </div>
    <div class="content-block row in_tab_list">
        <div class="tabs">

            <!-- <div id="tab1" class="tab in_hot_box activity_1 active">
                <div class="card demo-card-header-pic">
                    <a href="activity.html">
                    <div valign="bottom" class="card-header color-white no-border no-padding">
                        <img class='card-cover' src="img/raw_1498810476.jpeg" alt="">
                    </div>
                    <div class="card-content">
                        <div class="card-content-inner">
                            <p class="hot_list_title">NETech 2017 第二届中国（北京）国际互联网</p>
                            <p class="color-gray">发表于 2015/01/15</p>
                            <p class="color-gray"><span>白云区</span><span>20人已报名</span><span>￥10.00</span></p>
                        </div>
                    </div>
                    </a>
                </div>

                <div class="card demo-card-header-pic">
                    <a href="activity.html">
                    <div valign="bottom" class="card-header color-white no-border no-padding">
                        <img class='card-cover' src="img/raw_1498810476.jpeg" alt="">
                    </div>
                    <div class="card-content">
                        <div class="card-content-inner">
                            <p class="hot_list_title">NETech 2017 第二届中国（北京）国际互联网</p>
                            <p class="color-gray">发表于 2015/01/15</p>
                            <p class="color-gray"><span>白云区</span><span>20人已报名</span><span>￥10.00</span></p>
                        </div>
                    </div>
                    </a>
                </div>

                <div class="card demo-card-header-pic">
                    <a href="activity.html">
                    <div valign="bottom" class="card-header color-white no-border no-padding">
                        <img class='card-cover' src="img/raw_1498810476.jpeg" alt="">
                    </div>
                    <div class="card-content">
                        <div class="card-content-inner">
                            <p class="hot_list_title">NETech 2017 第二届中国（北京）国际互联网</p>
                            <p class="color-gray">发表于 2015/01/15</p>
                            <p class="color-gray"><span>白云区</span><span>20人已报名</span><span>￥10.00</span></p>
                        </div>
                    </div>
                    </a>
                </div>
            </div> -->
            <div id="tab2" class="tab in_hot_box active">
                {$data['details']|htmlspecialchars_decode}
                <!--<div class="card demo-card-header-pic">
                    <a href="activity.html">
                    <div valign="bottom" class="card-header color-white no-border no-padding">
                        <img class='card-cover' src="img/raw_1498810476.jpeg" alt="">
                    </div>
                    <div class="card-content">
                        <div class="card-content-inner">
                            <p class="hot_list_title">NETech 2017 第二届中国（北京）国际互联网</p>
                            <p class="color-gray">发表于 2015/01/15</p>
                            <p class="color-gray"><span>白云区</span><span>20人已报名</span><span>￥10.00</span></p>
                        </div>
                    </div>
                    </a>
                </div>

                <div class="card demo-card-header-pic">
                    <a href="activity.html">
                    <div valign="bottom" class="card-header color-white no-border no-padding">
                        <img class='card-cover' src="img/raw_1498810476.jpeg" alt="">
                    </div>
                    <div class="card-content">
                        <div class="card-content-inner">
                            <p class="hot_list_title">NETech 2017 第二届中国（北京）国际互联网</p>
                            <p class="color-gray">发表于 2015/01/15</p>
                            <p class="color-gray"><span>白云区</span><span>20人已报名</span><span>￥10.00</span></p>
                        </div>
                    </div>
                    </a>
                </div>

                <div class="card demo-card-header-pic">
                    <a href="activity.html">
                    <div valign="bottom" class="card-header color-white no-border no-padding">
                        <img class='card-cover' src="img/raw_1498810476.jpeg" alt="">
                    </div>
                    <div class="card-content">
                        <div class="card-content-inner">
                            <p class="hot_list_title">NETech 2017 第二届中国（北京）国际互联网</p>
                            <p class="color-gray">发表于 2015/01/15</p>
                            <p class="color-gray"><span>白云区</span><span>20人已报名</span><span>￥10.00</span></p>
                        </div>
                    </div>
                    </a>
                </div>-->
            </div>
        </div>
    </div>
</div>

<script type="text/javascript" src="http://g.alicdn.com/sj/lib/jquery/dist/jquery.min.js"></script>
<script type='text/javascript' src='http://g.alicdn.com/sj/lib/zepto/zepto.min.js' charset='utf-8'></script>
<script type='text/javascript' src='http://g.alicdn.com/msui/sm/0.6.2/js/sm.min.js' charset='utf-8'></script>
<!--城市选择结束-->
<script src="http://idangero.us/swiper/dist/js/swiper.min.js"></script>
<script type="text/javascript" src="js/huodon.js"></script>
<script>
    var swiper = new Swiper('.swiper-container', {
        pagination: '.swiper-pagination',
        paginationClickable: true
    });
</script>
</body>
</html>
<link rel="stylesheet" href="__PUBLIC__/Home/layer_mobile/need/layer.css" />
<script type="text/javascript" src="__PUBLIC__/Home/layer_mobile/layer.js" ></script>
<script>
    $("#user_hotel").submit(function () {
        var room_cateid = $("select[name='room_cateid']").val();
        var mobile = $("input[name='mobile']").val();
        var room_num = $("input[name='room_num']").val();
        var user_num = $("input[name='user_num']").val();
        var myArray = [
            {'val':room_cateid, 'message':'请选择房间类型'},
            {'val':mobile, 'message':'请输入手机号码', 'geshi':'手机格式不正确'},
            {'val':room_num, 'message':'请输入预定房间数'},
            {'val':user_num, 'message':'请输入入住人数'}
        ];

        var mobile_regular = /(1[3-9]\d{9})$/;  //手机
        //var email_regular = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;	//邮箱
        for (var i = 0; i < myArray.length; i++) {
            if(i == 0){
                if(myArray[i].val == ''){
                    message(myArray[i].message);
                   // layer.msg(msg);
                    return false;
                }
            }

            if(i = 1){
                if(myArray[i].val == ''){
                    message(myArray[i].message);
                    return false;
                }
                if(!mobile_regular.test(myArray[i].val)){
                    message(myArray[i].geshi);
                    return false;
                }
            }

            if(myArray[i].val == ''){
                message(myArray[i].message);
                return false;
            }else if(myArray[i].val == 0){
                message(myArray[i].message);
                return false;
            }
        }

        postform_userhotel();
    })

    //提示
    function message(msg){
        layer.open({
            content: msg,
            skin: 'msg',
            time: 2 //2秒后自动关闭
        });
    }

    //提交
    function postform_userhotel() {
        var formdata = $("#user_hotel").serialize();

        alert(formdata);
        $.ajax({
            type : 'post',
            url : "{:U('Serve/user_hotel')}",
            data :{'formdata':formdata},
            dataType : 'json',
            success : function (data) {
                if(data.status==1)
                    message(data.message);
                else
                    message(data.message);
            }
        })
    }
</script>